package com.ostrich.cloud.ostrichUserService.client;

import com.ostrich.cloud.common.result.Result;

import com.ostrich.ostrichUserService.param.bussiness.LoginBusParam;
import com.ostrich.ostrichUserService.param.bussiness.RegBussinessmanParam;
import com.ostrich.ostrichUserService.param.bussiness.UpdateBusParam;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import javax.validation.Valid;

@FeignClient(contextId = "businessmanMangerClient",name="ostrichUserService")
@Api("商家基本信息")
public interface BusinessmanMangerClient {

    @PostMapping("addBusiness")
    @ApiOperation("添加商户")
    public Result addBusiness(@RequestBody @Valid RegBussinessmanParam regBus);

   @GetMapping("updateBusState")
   public Result updateBusState(@RequestParam("parentId") Integer parentId,
                                @RequestParam("status") String status);

    @PostMapping("businessmanLogin")
    @ApiOperation("商家登录的接口")
    public Result businessmanLogin(@RequestBody LoginBusParam loginBusParam);

    @GetMapping("getAllBusiness")
    @ApiOperation("获取所有的商家")
    public Result getAllBusiness(@RequestParam("current") Integer current
            ,@RequestParam("size") Integer size,@RequestParam("status") String status);

    @ApiOperation("修改商家个人信息")
    @PutMapping("updateBusinessMessage")
    public Result updateBusinessMessage(@RequestBody @Valid
                                                    UpdateBusParam updateBusParam);


    @ApiOperation("获取附近10km的商家")
    @GetMapping("getAllBusinessByLocation")
    public Result getAllBusinessByLocation(@RequestParam("latitude") String latitude,
                                           @RequestParam("logitude")  String logitud,
                                           @RequestParam("radius") Double radius);

    @GetMapping("getOneBusinessByLocation")
    @ApiOperation("获取附近最近的一个商户")
    public Result getOneBusinessByLocation(@RequestParam("latitude") String latitude,
                                           @RequestParam("logitude")  String logitud);

    @GetMapping("getOnlyBusiness")
    @ApiOperation("获取商家个人信息")
    Result getOnlyBusiness();
}
